package com.sq.partner.manager.dao;


import java.util.List;
import java.util.Map;

import com.sq.partner.manager.mybatis.model.CoreDept;
import com.sq.partner.manager.mybatis.model.GatewayUser;
import com.sq.partner.manager.mybatis.model.TreeDto;
import com.sq.partner.manager.util.Page;

/**
 * 出单机构
 * @author zhihuizhao
 *
 */
public interface ICoreDeptDao {

	/**
	 * 分页查询出单机构
	 * @param page
	 * @return
	 * @throws Exception
	 */
	Page<CoreDept> queryCoreDeptPage(Page<CoreDept> page,String partnerNo) throws Exception;
	/**
	 * 急速出单快速配置分页查询出单机构
	 * @param page
	 * @return
	 * @throws Exception
	 */
	Page<CoreDept> queryCoreDeptPageJSCD(Page<CoreDept> page,String channnelCode) throws Exception;

	/**
	 * 分页查询出单机构(跟单费用配置)
	 * @param page
	 * @return
	 * @throws Exception
	 */
	Page<CoreDept> queryCoreDeptPage2(Page<CoreDept> page,String deptCode) throws Exception;

	/**
	 * 获取传入用户的权限机构及其分机构（分公司-- deptCode.length()==2 ）
	 * @return List<TreeDto> 包含deptCode 和 deptCname
	 * @throws Exception
	 */
	public Page<CoreDept> queryBranchDeptOfOneUser(Page<CoreDept> page,GatewayUser user) throws Exception;
	
	
	/**
	 * 根据当前登录用户的角色获取权限机构
	 * @param user
	 * @return
	 * @throws Exception
	 */
	List<TreeDto> queryDeptOfOneUser(GatewayUser user) throws Exception;
	
	Page<CoreDept> queryCoreDeptPageByParentCode(Page<CoreDept> page,String parentCode) throws Exception;
	
	public List<CoreDept> queryDeptList(String deptStr) throws Exception; 
	
	public boolean checkIsHasPrivilegeDept(CoreDept coreDept) throws Exception; 
	
	/**
	 * 没有合作伙伴可能分页查询出单机构
	 * @param page
	 * @return
	 * @throws Exception
	 */
	Page<CoreDept> queryCoreDeptPage1(Page<CoreDept> page,String partnerNo , GatewayUser gatewayuser) throws Exception;
	/**
	 * 广东费用跟单机构列表
	 */
	Page<CoreDept> queryPageDept(Page<CoreDept> page,String deptCode) throws Exception;
	/***
	 * 费用配置，机构获取name
	 */
	 List<CoreDept> queryDeptNameList(Map<String, Object> map) throws Exception; 
	/**
	 * 查询二级机构
	 */
	public List<CoreDept> queryForTwo() throws Exception;
	
	Page<CoreDept> queryCoreDeptForCar(Page<CoreDept> page,String dept) throws Exception;
	
	/*查询二位出单机构（省一级）*/
	List<CoreDept> queryProvenceDept() throws Exception;

	/**
	 * 查询2位和4位机构
	 */
	List<CoreDept> queryProvenceAndNextLevelDept() throws Exception;

	String queryDeptNameByDptCde(String dptCde) throws Exception;
}
